package UDP.sever;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class recive {
    public static void main(String[] args) throws IOException {
        DatagramSocket ds = new DatagramSocket(10000);
        while (true) {
            byte [] a = new byte[1024];
            DatagramPacket dp = new DatagramPacket(a,a.length);
            ds.receive(dp);
            byte [] data = dp.getData();
            int length = dp.getLength();
            System.out.println(new String(data,0,length));
        }
//        ds.close();
    }
}
